package com.hitqz.robot.api.business.enums;


import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author xupkun
 * @date 2024/7/24
 */
public enum GuideTaskStepActionEnum {
    GO("go", "前往点位"),
    SPEAK("speak", "语音介绍"),
    END("end", "执行结束动作"),
    ;

    private String code;

    private String desc;

    GuideTaskStepActionEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    private static final Map<String, GuideTaskStepActionEnum> MAP = Stream.of(GuideTaskStepActionEnum.values()).collect(Collectors.toMap(GuideTaskStepActionEnum::getCode, v -> v));

    public static GuideTaskStepActionEnum getByCode(String code) {
        return MAP.get(code);
    }
}
